package com.smart.campus.school.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.smart.campus.school.mapper.PsychologicalTestMapper;
import com.smart.campus.school.domain.PsychologicalTest;
import com.smart.campus.school.service.IPsychologicalTestService;
import com.smart.campus.common.core.text.Convert;

/**
 * 心理测试Service业务层处理
 * 
 * @author Zhihe.Li
 * @date 2020-05-27
 */
@Service
public class PsychologicalTestServiceImpl implements IPsychologicalTestService 
{
    @Autowired
    private PsychologicalTestMapper psychologicalTestMapper;

    /**
     * 查询心理测试
     * 
     * @param id 心理测试ID
     * @return 心理测试
     */
    @Override
    public PsychologicalTest selectPsychologicalTestById(Long id)
    {
        return psychologicalTestMapper.selectPsychologicalTestById(id);
    }

    /**
     * 查询心理测试列表
     * 
     * @param psychologicalTest 心理测试
     * @return 心理测试
     */
    @Override
    public List<PsychologicalTest> selectPsychologicalTestList(PsychologicalTest psychologicalTest)
    {
        return psychologicalTestMapper.selectPsychologicalTestList(psychologicalTest);
    }

    /**
     * 新增心理测试
     * 
     * @param psychologicalTest 心理测试
     * @return 结果
     */
    @Override
    public int insertPsychologicalTest(PsychologicalTest psychologicalTest)
    {
        return psychologicalTestMapper.insertPsychologicalTest(psychologicalTest);
    }

    /**
     * 修改心理测试
     * 
     * @param psychologicalTest 心理测试
     * @return 结果
     */
    @Override
    public int updatePsychologicalTest(PsychologicalTest psychologicalTest)
    {
        return psychologicalTestMapper.updatePsychologicalTest(psychologicalTest);
    }

    /**
     * 删除心理测试对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deletePsychologicalTestByIds(String ids)
    {
        return psychologicalTestMapper.deletePsychologicalTestByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除心理测试信息
     * 
     * @param id 心理测试ID
     * @return 结果
     */
    @Override
    public int deletePsychologicalTestById(Long id)
    {
        return psychologicalTestMapper.deletePsychologicalTestById(id);
    }
}
